const program = require('commander');

const { createProjectAction, addComponentAction } = require('./action');

const createCommands = () => {
  // 创建项目指令
  program
  .command('create <project> [other...]')
  .description('Create a new project')
  .action(createProjectAction);

  // 添加组件指令
  program
    .command('addcpn <name>')
    .description('add vue component, 例如: nxpm addcpn NavBar [-d src/components]')
    .action(name => addComponentAction(name, program.dest || 'src/components'))
}

module.exports = createCommands